package com.weic.easycache.utils;

public class StringUtils {
	public static final String EMPTY = "";
	public static final String SPACE = " ";

	public static String forceEllipsizeEnd(String s, int len) {
		if (s.length() > len) s = s.substring(0, len) + "...";
		return s;
	}

	public static boolean isBlank(String str) {
		boolean b = true;
		if (str != null) {
			int len = str.length();
			for (int i = 0; i < len; i++) {
				if (!Character.isWhitespace(str.charAt(i))) {
					b = false;
					break;
				}
			}
		}
		return b;
	}

	public static boolean isEmpty(String s) {
		return s == null || s.length() == 0;
	}
}
